using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using System.Security.Cryptography;
using PlugNT.Safe;
using PlugNT.Cms.Custom;
using PlugNT.Cms.Model;

namespace PlugNT.Cms.BLL
{
    public class SysModel
    {

        private static readonly PlugNT.Cms.DAL.SysModel dal = new PlugNT.Cms.DAL.SysModel();


        public static int GetDictionaryCount()
        {
            return PlugNT.Cms.DAL.SysModel.GetDictionaryCount();
        }

        public static SysModelInfo GetSysModelInfoByIndex(int index)
        {
            return PlugNT.Cms.DAL.SysModel.GetSysModelInfoByIndex(index);
        }


        public static bool Exists(int id)
        {
            return PlugNT.Cms.DAL.SysModel.Exists(id);
        }

        public static SysModelInfo GetSysModelInfoFromDictionary(int id)
        {
            return PlugNT.Cms.DAL.SysModel.GetSysModelInfoFromDictionary(id);
        }

        public static string GetMenuJson(int id)
        {
            object obj = PlugNT.Cms.DAL.SysModel.GetSingle("menu_json", " and id=" + id.ToString());
            return obj == null ? "" : obj.ToString();
        }

        public static string GetArticleJscode(int id)
        {
            object obj = PlugNT.Cms.DAL.SysModel.GetSingle("article_jscode", " and id=" + id.ToString());
            return obj == null ? "" : obj.ToString();
        }







        public bool Add(SysModelInfo model)
        {
            return dal.Add(model);
        }






        public bool Update(SysModelInfo model)
        {
            return dal.Update(model);
        }

        public bool UpdateArr(int id, string strArr)
        {
            return dal.UpdateArr(id, strArr);
        }

        public bool UpdateMenuJosn(int id, string menuJson)
        {
            return dal.UpdateMenuJosn(id, menuJson);
        }

        public bool UpdateArticleJscode(int id, string jsCode)
        {
            return dal.UpdateArticleJscode(id, jsCode);
        }






        public bool Delete(int id)
        {
            return dal.Delete(id);
        }

        public DataTable GetList(string andWhere)
        {
            return PlugNT.Cms.DAL.SysModel.GetList(andWhere);
        }

    }
}

